#include <iostream>
#include "House.h"

House::House(const std::string name, const std::vector<Player *> players, Deck *deck) {
	houseName = name;
	this->deck = deck;
	this->players = players;
}

bool House::askIfWantsOneCard(Player *onePlayer) const
{
	std::cout << onePlayer->getName() <<", do you want one more card? <y/n>";

	return false; //needs to handle an input from a player
}

void House::dealOneCardToItself()
{
	deck->dealOneCard(*this);
}

bool House::isHitting() const
{
	int temp =this->getTotal();
	if((16<temp) && (0>temp))
	{
		return true;
	}else return false;
}

void House::printHand() const
{
	std::cout<<this->GetName()<<" ";
	this->printHandActual();
}

void House::DealFirstRound()
{
	DealTwoCardsToItself();
	for(int i=0;i<players.size();++i)
	{
		DealTwoCardsToOnePlayer(players[i]);
	}
}

void House::dealOneCardToOnePlayer(Player *onePlayer)
{
	deck->dealOneCard(*onePlayer);
}






std::string House::GetName() const
{
	return houseName;
}

void House::DealTwoCardsToOnePlayer(Player *onePlayer)
{
	deck->dealOneCard(*onePlayer);
	deck->dealOneCard(*onePlayer);
}

void House::DealTwoCardsToItself()
{
	deck->dealOneCard(*this);
	(this->getCard(0))->setVisibility(true);
	deck->dealOneCard(*this);
}